<?php

class defaults extends db
{

    public function index()
    {
        if ( $_REQUEST['sub'] )
        {
            $ps = $this->admin_login( $_REQUEST['user'] , $_REQUEST['pass'] );
            switch ( $ps )
            {
                case TRUE:
                    session_start();
                    $_SESSION['uid'] = $ps['id'];
                    $_SESSION['user_shell'] = md5( $_REQUEST['user'] . md5( $_REQUEST['pass'] ) . ALL_PS );
                    header( "Location:index.php?app=main" );
                    break;
                case FALSE:
                    $error = TRUE;
                    break;
            }
        }

        if ( $error )
        {
            $this->assign( "error" , "你输错了，你肯定不是我老婆！！" );
        }

        $this->assign( "title" , "育人学校管理系统" );

        $this->display( "index.tpl" );
    }

}

?>